<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<%
    request.setCharacterEncoding("UTF-8");
    String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/StudentsListExamSubject.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
    <link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
    select {
        width: 234px;
        height: 31px
    }

    .gn_name {
        padding-top: 5px
    }

    .div_zilei {
        width: 100%;
        height: 30px
    }

    .tr {
        height: 40px;
        background: #57a0ff;
        font-weight:700;
    }

    .tr td {
        font-size: 14px;
        color: #ffffff
    }

    .tr_td {
        height: 40px;
    }

    .tr_td td {
        border-bottom: 1px solid #ededed;
        text-align: center;
    }

    tr td:nth-child(1) {
        font-size: 14px;
        color: #cccccc
    }

    .date {
        border: 0;
        background: #ffffff;
        text-align: center;
    }

    .tr_td td:nth-child(1) {
        border-left: 1px solid #cccccc;
    }

    .tr_td td:nth-child(3) {
        border-right: 1px solid #cccccc;
    }

    .addTable.deleteTable:HOVER {
        cursor: pointer;
    }

    type[type='checkbox'] {
        width: 15px
    }
    .addSubscribeStudent{
        background-color: #57a0ff;
        height: 35px;
        width: 130px;
        color: #ffffff;
        border: 0;
        margin-top: 20px;
        border-radius: 15px;
        padding: 5px;
        -moz-border-radius: 5px;
        outline: none;
        margin-right: 50px;
        cursor:pointer;
    }
</style>
<body style="background: #f5f5f5">
<div class="main">
    <div id="modal-overlay">

    </div>
    <div class="weizhi">
        <c:if test="${subjectTwoReg.cfbillstate eq 3}">
            考试管理>>科目二考试登记>>修改
        </c:if>
        <c:if test="${subjectTwoReg.cfbillstate eq 4 || subjectTwoReg.cfbillstate eq 5 }">
            考试管理>>科目二考试登记>>查看
        </c:if>
    </div>
    <div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 1150px">
		<c:if test="${subjectTwoReg.cfbillstate eq 3}">
        <div class="div_form">
            <form id="update_subjectTwoReg" action="<%=path%>/DrivingSys/updateSubjectTwoReg" method="post" class="form" onsubmit="return subForm()">
                	<input type="hidden" name="fid" value="${subjectTwoReg.fid }">
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                        <input type="text" name="name" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                        <input type="text" class="fnumber" name="fnumber" value="${subjectTwoReg.fnumber}" style="color: gray;" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">考试日期&nbsp;:&nbsp;</span>
                        <input type="text" name="fbizdate" id="ywrq" value="${subjectTwoReg.fbizdate }"
                               onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" onchange="changeFbizdate($(this))"/>
                         <input type="hidden" id="subjectType" value="3">
                        <img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
                             src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                        <input name="fdescription" value="${subjectTwoReg.fdescription }"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                        <select  name="cfbillstate" >
                            <option id="shenhe" style="color: gray;" value="3">保存</option>
                        </select>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">车型&nbsp;:&nbsp;</span>
                        <select class="cfcartype" name="cfcartype" onchange="changeCartype()">
                        	<option value="${ subjectTwoReg.cfcartype}">${subjectTwoReg.cfcartype }</option>
                        	<option value="A1">A1</option>
                        	<option value="A2">A2</option>
                        	<option value="A3">A3</option>
                        	<option value="B1">B1</option>
                        	<option value="B2">B2</option>
                        	<option value="C1">C1</option>
                        	<option value="C2">C2</option>
                        	<option value="C3">C3</option>
                        	<option value="C4">C4</option>
                        	<option value="D">D</option>
                        	<option value="E">E</option>
                        	<option value="F">F</option>
                        	<option value="M">M</option>
                            <option value="N">N</option>
                        	<option value="P">P</option>
                        </select>
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">指标数(伊兰特)&nbsp;:&nbsp;</span>
                        <input id="cfzbsylt" name="cfzbsylt" value="${subjectTwoReg.cfzbsylt }" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">指标数(桑塔纳)&nbsp;:&nbsp;</span>
                        <input id="cfzbsstn" name="cfzbsstn" value="${subjectTwoReg.cfzbsstn }" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">总指标数&nbsp;:&nbsp;</span>
                        <input id="cfzbs" name="cfzbs" value="${subjectTwoReg.cfzbs }" readonly="readonly"/>
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">

                    </div>
                    <div class="input_hang">

                    </div>
                    <div class="input_hang">
                        <span class="gn_name">总报考数&nbsp;:&nbsp;</span>
                        <input id="cfdqbkrs" name="cfzbks" value="${subjectTwoReg.cfzbks }" readonly="readonly"/>
                    </div>
                </div>
                <div style="margin-left: 90px;">确认报考学员&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="addSubscribeStudent"  value="添加预约学员" /></div>
                <div class="div_zilei">
                    <div style="width: 93%;text-align: right;">
                        <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                        <span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
                        <img src="<%=path%>/image/delete212.png" class="deleteTable">
                        <span class="deleteTable" style="color:#57a0ff;font-weight:700;font-size: 14px" class="deleteTable">删除</span>
                    </div>
                </div>
                <div style="overflow:auto;/* min-height: 200px; */width: 88%; height:250px;margin-left: 90px">
                    <table id="table1" style="min-height:50px;border-spacing:0;width: 160%;white-space:nowrap;">
                        <tr  class="tr">
                        	<td><%--<input type="checkbox" class="check1">--%></td>
                            <td class="fseq">序号</td>
                            <td style="width: 90px;" align="center">准考证明编号</td>
                            <td style="width: 90px;" align="center">学员姓名</td>
                            <td style="width: 90px;" align="center">学员编码</td>
                            <td style="width: 90px;" align="center">编号</td>
                            <td style="width: 90px;" align="center">身份证号</td>
                            <td style="width: 90px;" align="center">性别</td>
                            <td style="width: 90px;" align="center">手机号码</td>
                            <td style="width: 90px;" align="center">电话</td>
                            <td style="width: 90px;" align="center">推荐人</td>
                            <td style="width: 90px;" align="center">申请准驾车型代号</td>
                            <td style="width: 90px;" align="center">教练</td>
                            <td style="width: 90px;" align="center">车型</td>
                            <td style="width: 90px;" align="center">本地/异地</td>
                            <td style="width: 90px;" align="center">考试次数</td>
                            <td style="width: 90px;" align="center">初考/补考</td>
                            <td style="width: 90px;" align="center">本校/外校</td>
                            <td style="width: 90px;" align="center">科目一及格时间</td>
                            <td style="width: 90px;" align="center">科目二不及格时间</td>
                            <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                            <td style="width: 90px;" align="center">班级</td>
                            <td style="width: 90px;" align="center">已收</td>
                            <td style="width: 90px;" align="center">优惠</td>
                            <td style="width: 90px;" align="center">应收</td>
                            <td style="width: 90px;" align="center">欠费</td>
                            <td style="width: 90px;" align="center">备注</td>
                            <td style="width: 90px;" align="center">档案交接</td>
                            <td style="width: 90px;" align="center">技能表交接</td>
                        </tr>
                        <c:forEach items="${subjectTwoReg.subjectTwoRegentryList }" var="subjectTwoRegentry">
									<tr class="tr_td">
										<td><input type="checkbox" name="checkchilden"
											value="${subjectTwoRegentry.cfstudentid }"></td>
										<td><input type="text" class="fseq" name="subfseq"
											value="${subjectTwoRegentry.fseq }" readonly="readonly"> <input type="hidden"
											class="subfid" name="subfid" value="${subjectTwoRegentry.cfstudentid }"
											readonly="readonly"> <input type="hidden" class="subcfclazzid"
											name="subcfclazzid" value="" readonly="readonly">
										</td>
										<td align="center"><input class="cfzkzmbh"
											style="width: 90px;" type="text" name="subcfzkzmbh"
											value="${subjectTwoRegentry.cfzkzmbh}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subfnameL2" value="${subjectTwoRegentry.studentName}"
											class="clickName is_click_ne" readonly="readonly"/></td>
										<td align="center"><input style="width: 170px;"
											type="text" name="substufnumber" value="${subjectTwoRegentry.cfstudentno}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subfnumber" value="" readonly="readonly"/></td>
										<td align="center"><input style="width: 140px;"
											type="text" name="subcfidcardno" value="${subjectTwoRegentry.cfidcardno}" readonly="readonly"/></td>
										<c:if test="${subjectTwoRegentry.cfsex eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsex" value="男" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfsex eq 2 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsex" value="女" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsjhm" value="${subjectTwoRegentry.cfmobile}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflxdh" value="${subjectTwoRegentry.cfphone}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcftjrName" value="${subjectTwoRegentry.cfjsr}" readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="cfsqzjcxdh" value="${subjectTwoRegentry.cfsqzjcxdh}" readonly="readonly"></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subjlname" value="${subjectTwoRegentry.jlzname}" readonly="readonly"/> <input
											type="hidden" name="subcfjiaolianid" value="${subjectTwoRegentry.cfjiaolianid}">
										</td>
										<td align="center"><input style="width: 120px;"
											type="text" name="subcfchexing" value="${subjectTwoRegentry.cfchexing}"></td>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="本地" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 2 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="异地" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 3 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="学生" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfkscs" value="${subjectTwoRegentry.cfkscs}" readonly="readonly"/></td>
										<c:if test="${subjectTwoRegentry.cfkscs eq 0}">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkscs gt 0}">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfckbk" value="补考" readonly="readonly"/></td>
										</c:if>
										 <c:if test="${subjectTwoRegentry.cfkscs eq null}">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
                                         </c:if>
										<c:if test="${subjectTwoRegentry.cfbxwx eq null}">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfbxwx" value="" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbxwx eq 1}">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfbxwx" value="本校" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbxwx eq 2 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfbxwx" value="外校" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj eq null }">
											<td align="center"><input style="width: 90px;"
											type="text" name="subcfkmyjgsj" value="" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
											<td align="center"><input style="width: 140px;"
											type="text" name="subcfkmyjgsj" value="${subjectTwoRegentry.cfkmyjgsj}" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj == null }">
											<td align="center"><input style="width: 140px;"
											type="text" name="subcfbjgsj" value="" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfbjgsj" value="${subjectTwoRegentry.cfbjgsj}" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfscts" value="${subjectTwoRegentry.cfscts}" readonly="readonly"/></td>
										<td align="center"><input style="width: 150px;"
											type="text" name="subcfclazz" value="${subjectTwoRegentry.cfclazz}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfysje" value="${subjectTwoRegentry.cfysje}" readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfyhje" value="${subjectTwoRegentry.cfyhje}" readonly="readonly"></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfyisje" value="${subjectTwoRegentry.cfyisje}" readonly="readonly"></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfqfje" value="${subjectTwoRegentry.cfqfje}" readonly="readonly"></td>
										<td align="center"><input style="width: 150px;"
											type="text" name="subcfremark" value="${subjectTwoRegentry.cfremark}" /></td>
										<c:if test="${subjectTwoRegentry.cfdajj eq 0 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfdajj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfdajj eq null }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfdajj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfdajj eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" checked="checked" disabled="disabled"
											readonly="readonly" name="subcfdajj" value="1" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq 0 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfjnbjj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq null }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfjnbjj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" checked="checked" disabled="disabled"
											readonly="readonly" name="subcfjnbjj" value="1" /></td>
										</c:if>
									</tr>
								</c:forEach>
                    </table>
                </div>

                <div style="margin-top: 10px; margin-left: 90px;">已退学员</div>
                <div class="div_zilei">
                   <%--  <div style="width: 88%;text-align: right;">
                        <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                        <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
                        <img src="<%=path%>/image/delete212.png" class="deleteTable">
                        <span class="deleteTable" style="color: #a9bbe0;font-size: 14px" class="deleteTable">删除</span>
                    </div> --%>
                </div>
                <div style="overflow:auto;min-height: 200px;width: 88%;margin-left: 90px">
                    <table id="table2" style="min-height:50px;border-spacing:0;width: 160%;white-space:nowrap;">
                        <tr class="tr">
                            <tr  class="tr">
                        	<td><%--<input type="checkbox">--%></td>
                            <td class="fseq">序号</td>
                            <td style="width: 90px;" align="center">准考证明编号</td>
                            <td style="width: 90px;" align="center">学员姓名</td>
                            <td style="width: 90px;" align="center">学员编码</td>
                            <td style="width: 90px;" align="center">编号</td>
                            <td style="width: 90px;" align="center">身份证号</td>
                            <td style="width: 90px;" align="center">性别</td>
                            <td style="width: 90px;" align="center">手机号码</td>
                            <td style="width: 90px;" align="center">电话</td>
                            <td style="width: 90px;" align="center">推荐人</td>
                            <td style="width: 90px;" align="center">申请准驾车型代号</td>
                            <td style="width: 90px;" align="center">教练</td>
                            <td style="width: 90px;" align="center">车型</td>
                            <td style="width: 90px;" align="center">本地/异地</td>
                            <td style="width: 90px;" align="center">考试次数</td>
                            <td style="width: 90px;" align="center">初考/补考</td>
                            <td style="width: 90px;" align="center">本校/外校</td>
                            <td style="width: 90px;" align="center">科目一及格时间</td>
                            <td style="width: 90px;" align="center">科目二不及格时间</td>
                            <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                            <td style="width: 90px;" align="center">班级</td>
                            <td style="width: 90px;" align="center">已收</td>
                            <td style="width: 90px;" align="center">优惠</td>
                            <td style="width: 90px;" align="center">应收</td>
                            <td style="width: 90px;" align="center">欠费</td>
                            <td style="width: 90px;" align="center">备注</td>
                            <td style="width: 90px;" align="center">档案交接</td>
                        <td style="width: 90px;" align="center">技能表交接</td>
                        </tr>
                    </table>
                </div>
				<div class="div_input_hang">

                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                        <input name="checkName" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                        <input name="createName" value="${subjectTwoReg.createName }" readonly="readonly"/>

                    </div>
                    <div class="input_hang">
                        <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                        <input name="fcreatetime"  style="color: gray;" readonly="readonly" value="${subjectTwoReg.fcreatetime }"/>
                    </div>
                </div>

                <div class="div_tj" style="padding-top: 0px">
                <%--	<c:if test="${subjectTwoReg.cfbillstate != 5}">
                            <div>
                                <input type="button" class="input_submit" value="审 核" onclick="audit()"/>
                            </div>
                    </c:if>--%>
                    <shiro:hasPermission name="/sureSubjectTwoReg">
                        <div>
                            <input class="input_submit bc" value="" type="submit">
                        </div>
                    </shiro:hasPermission>

                    <shiro:hasPermission name="/submitAuditSubjectTwoReg">
                        <div>
                            <input  class="input_submit tj" value="" type="button" onclick="audit(4)">
                        </div>
                    </shiro:hasPermission>
                    <div>
                        <input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('${activitiBPMN_KEY}',$('.fnumber').val())">
                     </div>

                    <div>
                        <input type="button" class="input_back fh" value="" onclick="back()"/>
                    </div>
                </div>
            </form>
        </div>
        </c:if>

        <c:if test="${subjectTwoReg.cfbillstate eq 4}">
            <div class="div_form">
                <form id="update_subjectTwoReg" action="<%=path%>/DrivingSys/updateSubjectTwoReg" method="post" class="form" >
                    <input type="hidden" name="fid" value="${subjectTwoReg.fid }">
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                            <input type="text" name="name" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                            <input class="fnumber" type="text" name="fnumber" value="${subjectTwoReg.fnumber}" style="color: gray;" readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">考试日期&nbsp;:&nbsp;</span>
                            <input type="text" name="fbizdate" id="ywrq" value="${subjectTwoReg.fbizdate }"
                                   onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
                            <input type="hidden" id="subjectType" value="3">
                            <img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
                                 src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                            <input name="fdescription" value="${subjectTwoReg.fdescription }" readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                            <select  name="cfbillstate" >
                                <option id="shenhe" style="color: gray;" value="4">提交</option>
                            </select>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">车型&nbsp;:&nbsp;</span>
                            <select class="cfcartype" name="cfcartype" disabled="disabled">
                                <option value="${ subjectTwoReg.cfcartype}">${subjectTwoReg.cfcartype }</option>
                                <option value="A1">A1</option>
                                <option value="A2">A2</option>
                                <option value="A3">A3</option>
                                <option value="B1">B1</option>
                                <option value="B2">B2</option>
                                <option value="C1">C1</option>
                                <option value="C2">C2</option>
                                <option value="C3">C3</option>
                                <option value="C4">C4</option>
                                <option value="D">D</option>
                                <option value="E">E</option>
                                <option value="F">F</option>
                                <option value="M">M</option>
                                <option value="N">N</option>
                                <option value="P">P</option>
                            </select>
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">指标数(伊兰特)&nbsp;:&nbsp;</span>
                            <input id="cfzbsylt" name="cfzbsylt" value="${subjectTwoReg.cfzbsylt }" readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">指标数(桑塔纳)&nbsp;:&nbsp;</span>
                            <input id="cfzbsstn" name="cfzbsstn" value="${subjectTwoReg.cfzbsstn }" readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">总指标数&nbsp;:&nbsp;</span>
                            <input id="cfzbs" name="cfzbs" value="${subjectTwoReg.cfzbs }" readonly="readonly"/>
                        </div>
                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">

                        </div>
                        <div class="input_hang">

                        </div>
                        <div class="input_hang">
                            <span class="gn_name">总报考数&nbsp;:&nbsp;</span>
                            <input id="cfdqbkrs" name="cfzbks" value="${subjectTwoReg.cfzbks }" readonly="readonly"/>
                        </div>
                    </div>
                    <div style="margin-left: 90px;">确认报考学员&nbsp;&nbsp;&nbsp;&nbsp;<%--<span><a class="addSubscribeStudent" href ="#">添加预约学员</a></span>--%></div>
                    <div class="div_zilei">
                        <%--<div style="width: 88%;text-align: right;">
                            <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                            <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
                            <img src="<%=path%>/image/delete212.png" class="deleteTable">
                            <span class="deleteTable" style="color: #a9bbe0;font-size: 14px" class="deleteTable">删除</span>
                        </div>--%>
                    </div>
                    <div style="overflow:auto;/* min-height: 200px; */width: 88%; height:250px;margin-left: 90px">
                        <table id="table1" style="min-height:50px;border-spacing:0;width: auto;white-space:nowrap;">
                            <tr  class="tr">
                                <td><%--<input type="checkbox" class="check1">--%></td>
                                <td class="fseq">序号</td>
                                <td style="width: 90px;" align="center">准考证明编号</td>
                                <td style="width: 90px;" align="center">学员姓名</td>
                                <td style="width: 90px;" align="center">学员编码</td>
                                <td style="width: 90px;" align="center">编号</td>
                                <td style="width: 90px;" align="center">身份证号</td>
                                <td style="width: 90px;" align="center">性别</td>
                                <td style="width: 90px;" align="center">手机号码</td>
                                <td style="width: 90px;" align="center">电话</td>
                                <td style="width: 90px;" align="center">推荐人</td>
                                <td style="width: 90px;" align="center">申请准驾车型代号</td>
                                <td style="width: 90px;" align="center">教练</td>
                                <td style="width: 90px;" align="center">车型</td>
                                <td style="width: 90px;" align="center">本地/异地</td>
                                <td style="width: 90px;" align="center">考试次数</td>
                                <td style="width: 90px;" align="center">初考/补考</td>
                                <td style="width: 90px;" align="center">本校/外校</td>
                                <td style="width: 90px;" align="center">科目一及格时间</td>
                                <td style="width: 90px;" align="center">科目二不及格时间</td>
                                <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                                <td style="width: 90px;" align="center">班级</td>
                                <td style="width: 90px;" align="center">已收</td>
                                <td style="width: 90px;" align="center">优惠</td>
                                <td style="width: 90px;" align="center">应收</td>
                                <td style="width: 90px;" align="center">欠费</td>
                                <td style="width: 90px;" align="center">备注</td>
                                <td style="width: 90px;" align="center">档案交接</td>
                                <td style="width: 90px;" align="center">技能表交接</td>
                            </tr>
                            <c:forEach items="${subjectTwoReg.subjectTwoRegentryList }" var="subjectTwoRegentry">
                                <tr class="tr_td">
                                    <td><input type="checkbox" name="checkchilden"
                                               value="${subjectTwoRegentry.cfstudentid }" readonly="readonly"/></td>
                                    <td><input type="text" class="fseq" name="subfseq"
                                               value="${subjectTwoRegentry.fseq }" readonly="readonly"> <input type="hidden"
                                                                                                               class="subfid" name="subfid" value="${subjectTwoRegentry.cfstudentid }"
                                                                                                               readonly="readonly"> <input type="hidden" class="subcfclazzid"
                                                                                                                                           name="subcfclazzid" value="" readonly="readonly">
                                    </td>
                                    <td align="center"><input class="cfzkzmbh"
                                                              style="width: 90px;" type="text" name="subcfzkzmbh"
                                                              value="${subjectTwoRegentry.cfzkzmbh}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subfnameL2" value="${subjectTwoRegentry.studentName}"
                                                               readonly="readonly"/></td>
                                    <td align="center"><input style="width: 170px;"
                                                              type="text" name="substufnumber" value="${subjectTwoRegentry.cfstudentno}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subfnumber" value="" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 140px;"
                                                              type="text" name="subcfidcardno" value="${subjectTwoRegentry.cfidcardno}" readonly="readonly"/></td>
                                    <c:if test="${subjectTwoRegentry.cfsex eq 1 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfsex" value="男" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfsex eq 2 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfsex" value="女" readonly="readonly"/></td>
                                    </c:if>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcfsjhm" value="${subjectTwoRegentry.cfmobile}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcflxdh" value="${subjectTwoRegentry.cfphone}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcftjrName" value="${subjectTwoRegentry.cfjsr}" readonly="readonly"/></td>
                                    <td align="center"><input type="text"
                                                              style="width: 90px;" name="cfsqzjcxdh" value="${subjectTwoRegentry.cfsqzjcxdh}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subjlname" value="${subjectTwoRegentry.jlzname}" readonly="readonly"/> <input
                                            type="hidden" name="subcfjiaolianid" value="${subjectTwoRegentry.cfjiaolianid}">
                                    </td>
                                    <td align="center"><input style="width: 120px;"
                                                              type="text" name="subcfchexing" value="${subjectTwoRegentry.cfchexing}" readonly="readonly"/></td>
                                    <c:if test="${subjectTwoRegentry.cfbdyd eq 1 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcflocal" value="本地" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfbdyd eq 2 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcflocal" value="异地" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfbdyd eq 3 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcflocal" value="学生" /></td>
                                    </c:if>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcfkscs" value="${subjectTwoRegentry.cfkscs}" readonly="readonly"/></td>
                                    <c:if test="${subjectTwoRegentry.cfkscs eq 0}">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkscs gt 0}">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfckbk" value="补考" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkscs eq null}">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfbxwx eq null}">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfbxwx" value="" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfbxwx eq 1}">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfbxwx" value="本校" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfbxwx eq 2 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfbxwx" value="外校" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkmyjgsj eq null }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfkmyjgsj" value="" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
                                        <td align="center"><input style="width: 140px;"
                                                                  type="text" name="subcfkmyjgsj" value="${subjectTwoRegentry.cfkmyjgsj}" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkmyjgsj == null }">
                                        <td align="center"><input style="width: 140px;"
                                                                  type="text" name="subcfbjgsj" value="" readonly="readonly"/></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="text" name="subcfbjgsj" value="${subjectTwoRegentry.cfbjgsj}" readonly="readonly"/></td>
                                    </c:if>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcfscts" value="${subjectTwoRegentry.cfscts}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 150px;"
                                                              type="text" name="subcfclazz" value="${subjectTwoRegentry.cfclazz}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 90px;"
                                                              type="text" name="subcfysje" value="${subjectTwoRegentry.cfysje}" readonly="readonly"/></td>
                                    <td align="center"><input type="text"
                                                              style="width: 90px;" name="subcfyhje" value="${subjectTwoRegentry.cfyhje}" readonly="readonly"/></td>
                                    <td align="center"><input type="text"
                                                              style="width: 90px;" name="subcfyisje" value="${subjectTwoRegentry.cfyisje}" readonly="readonly"/></td>
                                    <td align="center"><input type="text"
                                                              style="width: 90px;" name="subcfqfje" value="${subjectTwoRegentry.cfqfje}" readonly="readonly"/></td>
                                    <td align="center"><input style="width: 150px;"
                                                              type="text" name="subcfremark" value="${subjectTwoRegentry.cfremark}" readonly="readonly"/></td>
                                    <c:if test="${subjectTwoRegentry.cfdajj eq 0 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" disabled="disabled" readonly="readonly"
                                                                  name="subcfdajj" value="0" /></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfdajj eq null }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" disabled="disabled" readonly="readonly"
                                                                  name="subcfdajj" value="0" /></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfdajj eq 1 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" checked="checked" disabled="disabled"
                                                                  readonly="readonly" name="subcfdajj" value="1" /></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfjnbjj eq 0 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" disabled="disabled" readonly="readonly"
                                                                  name="subcfjnbjj" value="0" /></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfjnbjj eq null }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" disabled="disabled" readonly="readonly"
                                                                  name="subcfjnbjj" value="0" /></td>
                                    </c:if>
                                    <c:if test="${subjectTwoRegentry.cfjnbjj eq 1 }">
                                        <td align="center"><input style="width: 90px;"
                                                                  type="checkbox" checked="checked" disabled="disabled"
                                                                  readonly="readonly" name="subcfjnbjj" value="1" /></td>
                                    </c:if>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>

                    <div style="margin-top: 10px; margin-left: 90px;">已退学员</div>
                    <div class="div_zilei">
                            <%--  <div style="width: 88%;text-align: right;">
                                 <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                 <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
                                 <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                 <span class="deleteTable" style="color: #a9bbe0;font-size: 14px" class="deleteTable">删除</span>
                             </div> --%>
                    </div>
                    <div style="overflow:auto;min-height: 200px;width: 88%;margin-left: 90px">
                        <table id="table2" style="min-height:50px;border-spacing:0;width: 160%;white-space:nowrap;">
                            <tr class="tr">
                            <tr  class="tr">
                                <td><%--<input type="checkbox">--%></td>
                                <td class="fseq">序号</td>
                                <td style="width: 90px;" align="center">准考证明编号</td>
                                <td style="width: 90px;" align="center">学员姓名</td>
                                <td style="width: 90px;" align="center">学员编码</td>
                                <td style="width: 90px;" align="center">编号</td>
                                <td style="width: 90px;" align="center">身份证号</td>
                                <td style="width: 90px;" align="center">性别</td>
                                <td style="width: 90px;" align="center">手机号码</td>
                                <td style="width: 90px;" align="center">电话</td>
                                <td style="width: 90px;" align="center">推荐人</td>
                                <td style="width: 90px;" align="center">申请准驾车型代号</td>
                                <td style="width: 90px;" align="center">教练</td>
                                <td style="width: 90px;" align="center">车型</td>
                                <td style="width: 90px;" align="center">本地/异地</td>
                                <td style="width: 90px;" align="center">考试次数</td>
                                <td style="width: 90px;" align="center">初考/补考</td>
                                <td style="width: 90px;" align="center">本校/外校</td>
                                <td style="width: 90px;" align="center">科目一及格时间</td>
                                <td style="width: 90px;" align="center">科目二不及格时间</td>
                                <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                                <td style="width: 90px;" align="center">班级</td>
                                <td style="width: 90px;" align="center">已收</td>
                                <td style="width: 90px;" align="center">优惠</td>
                                <td style="width: 90px;" align="center">应收</td>
                                <td style="width: 90px;" align="center">欠费</td>
                                <td style="width: 90px;" align="center">备注</td>
                                <td style="width: 90px;" align="center">档案交接</td>
                                <td style="width: 90px;" align="center">技能表交接</td>
                            </tr>
                        </table>
                    </div>
                    <div class="div_input_hang">

                    </div>
                    <div class="div_input_hang">
                        <div class="input_hang">
                            <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                            <input name="checkName" readonly="readonly"/>
                        </div>
                        <div class="input_hang">
                            <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                            <input name="createName" value="${subjectTwoReg.createName }" readonly="readonly"/>

                        </div>
                        <div class="input_hang">
                            <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                            <input name="fcreatetime"  style="color: gray;" readonly="readonly" value="${subjectTwoReg.fcreatetime }" readonly="readonly"/>
                        </div>
                    </div>

                    <div class="div_tj" style="padding-top: 0px">
                        <shiro:hasPermission name="/auditSubjectTwoReg">
                            <c:if test="${activitiState eq 'power'}">
                                <div>
                                    <input class="input_submit sh" value="" type="button" onclick="audit(5)">
                                </div>
                            </c:if>
                        </shiro:hasPermission>
                        <shiro:hasPermission name="/againstAuditSubjectTwoReg">
                            <div>
                                <input  class="input_submit fsh" value="" type="button" onclick="audit(3)">
                            </div>
                        </shiro:hasPermission>
                        <div>
                            <input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('${activitiBPMN_KEY}',$('.fnumber').val())">
                        </div>
                        <div>
                            <input type="button" class="input_back fh" value="" onclick="back()"/>
                        </div>
                    </div>
                </form>
            </div>
        </c:if>


        <c:if test="${subjectTwoReg.cfbillstate eq 5}">
        <div class="div_form">
            <form id="update_subjectTwoReg" action="<%=path%>/DrivingSys/updateSubjectTwoReg" method="post" class="form">
                	<input type="hidden" name="fid" value="${subjectTwoReg.fid }">
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">驾校&nbsp;:&nbsp;</span>
                        <input disabled="disabled" type="text" name="name" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">单据编号&nbsp;:&nbsp;</span>
                        <input disabled="disabled" class="fnumber" type="text" name="fnumber" value="${subjectTwoReg.fnumber}" style="color: gray;" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">考试日期&nbsp;:&nbsp;</span>
                        <input disabled="disabled" type="text" name="fbizdate" id="ywrq" value="${subjectTwoReg.fbizdate }"
                               onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
                         <input type="hidden" id="subjectType" value="2">
                        <img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"
                             src="<%=path%>/image/date.jpg" align="absmiddle" style="padding-left: 15px">
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">参考信息&nbsp;:&nbsp;</span>
                        <input disabled="disabled" name="fdescription" value="${subjectTwoReg.fdescription }"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">单据状态&nbsp;:&nbsp;</span>
                        <select  name="cfbillstate" >
                        	<c:if test="${subjectTwoReg.cfbillstate eq 5 }">
                        		<option class="shenhe" style="color: gray;" value="5">审核</option>
                            </c:if>
                        </select>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">车型&nbsp;:&nbsp;</span>
                        <select class="cfcartype" name="cfcartype" disabled="disabled">>
                        	<option value="${ subjectTwoReg.cfcartype}">${subjectTwoReg.cfcartype }</option>
                        	<option value="A1">A1</option>
                        	<option value="A2">A2</option>
                        	<option value="A3">A3</option>
                        	<option value="B1">B1</option>
                        	<option value="B2">B2</option>
                        	<option value="C1">C1</option>
                        	<option value="C2">C2</option>
                        	<option value="C3">C3</option>
                        	<option value="C4">C4</option>
                        	<option value="D">D</option>
                        	<option value="E">E</option>
                        	<option value="F">F</option>
                        	<option value="M">M</option>
                            <option value="N">N</option>
                        	<option value="P">P</option>
                        </select>
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">指标数(伊兰特)&nbsp;:&nbsp;</span>
                        <input disabled="disabled" id="cfzbsylt" name="cfzbsylt" value="${subjectTwoReg.cfzbsylt }" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">指标数(桑塔纳)&nbsp;:&nbsp;</span>
                        <input disabled="disabled" id="cfzbsstn" name="cfzbsstn" value="${subjectTwoReg.cfzbsstn }" readonly="readonly"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">总指标数&nbsp;:&nbsp;</span>
                        <input disabled="disabled" id="cfzbs" name="cfzbs" value="${subjectTwoReg.cfzbs }" readonly="readonly"/>
                    </div>
                </div>
                <div class="div_input_hang">
                    <div class="input_hang">

                    </div>
                    <div class="input_hang">

                    </div>
                    <div class="input_hang">
                        <span class="gn_name">总报考数&nbsp;:&nbsp;</span>
                        <input disabled="disabled" id="cfdqbkrs" name="cfzbks" value="${subjectTwoReg.cfzbks }" readonly="readonly"/>
                    </div>
                </div>
                <div style="margin-left: 90px;">确认报考学员&nbsp;&nbsp;&nbsp;&nbsp;<%--<span><a href ="javascript:return false;">添加预约学员</a></span>--%></div>
                <div class="div_zilei">
                    <%--<div style="width: 88%;text-align: right;">
                        <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                        <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
                        <img src="<%=path%>/image/delete212.png" class="deleteTable">
                        <span class="deleteTable" style="color: #a9bbe0;font-size: 14px" class="deleteTable">删除</span>
                    </div>--%>
                </div>
                <div style="overflow:auto;/* min-height: 200px; */width: 88%; height:250px;margin-left: 90px">
                    <table id="table1" style="min-height:50px;border-spacing:0;width: auto;white-space:nowrap;">
                        <tr  class="tr">
                        	<td><%--<input type="checkbox">--%></td>
                            <td class="fseq">序号</td>
                            <td style="width: 90px;" align="center">准考证明编号</td>
                            <td style="width: 90px;" align="center">学员姓名</td>
                            <td style="width: 90px;" align="center">学员编码</td>
                            <td style="width: 90px;" align="center">编号</td>
                            <td style="width: 90px;" align="center">身份证号</td>
                            <td style="width: 90px;" align="center">性别</td>
                            <td style="width: 90px;" align="center">手机号码</td>
                            <td style="width: 90px;" align="center">电话</td>
                            <td style="width: 90px;" align="center">推荐人</td>
                            <td style="width: 90px;" align="center">申请准驾车型代号</td>
                            <td style="width: 90px;" align="center">教练</td>
                            <td style="width: 90px;" align="center">车型</td>
                            <td style="width: 90px;" align="center">本地/异地</td>
                            <td style="width: 90px;" align="center">考试次数</td>
                            <td style="width: 90px;" align="center">初考/补考</td>
                            <td style="width: 90px;" align="center">本校/外校</td>
                            <td style="width: 90px;" align="center">科目一及格时间</td>
                            <td style="width: 90px;" align="center">科目二不及格时间</td>
                            <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                            <td style="width: 90px;" align="center">班级</td>
                            <td style="width: 90px;" align="center">已收</td>
                            <td style="width: 90px;" align="center">优惠</td>
                            <td style="width: 90px;" align="center">应收</td>
                            <td style="width: 90px;" align="center">欠费</td>
                            <td style="width: 90px;" align="center">备注</td>
                            <td style="width: 90px;" align="center">档案交接</td>
                            <td style="width: 90px;" align="center">技能表交接</td>
                        </tr>
                        <c:forEach items="${subjectTwoReg.subjectTwoRegentryList }" var="subjectTwoRegentry">
									<tr class="tr_td">
										<td><input type="checkbox" name="checkchilden"
											value="${subjectTwoRegentry.cfstudentid }"></td>
										<td><input type="text" class="fseq" name="subfseq"
											value="${subjectTwoRegentry.fseq }" readonly="readonly"> <input type="hidden"
											class="subfid" name="subfid" value="${subjectTwoRegentry.cfstudentid }"
											readonly="readonly"> <input type="hidden" class="subcfclazzid"
											name="subcfclazzid" value="" readonly="readonly">
										</td>
										<td align="center"><input class="cfzkzmbh"
											style="width: 90px;" type="text" name="subcfzkzmbh"
											value="${subjectTwoRegentry.cfzkzmbh}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subfnameL2" value="${subjectTwoRegentry.studentName}"
                                                                  readonly="readonly"/></td>
										<td align="center"><input style="width: 170px;"
											type="text" name="substufnumber" value="${subjectTwoRegentry.cfstudentno}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subfnumber" value="" readonly="readonly"/></td>
										<td align="center"><input style="width: 140px;"
											type="text" name="subcfidcardno" value="${subjectTwoRegentry.cfidcardno}" readonly="readonly"/></td>
										<c:if test="${subjectTwoRegentry.cfsex eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsex" value="男" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfsex eq 2 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsex" value="女" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfsjhm" value="${subjectTwoRegentry.cfmobile}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflxdh" value="${subjectTwoRegentry.cfphone}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcftjrName" value="${subjectTwoRegentry.cfjsr}" readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="cfsqzjcxdh" value="${subjectTwoRegentry.cfsqzjcxdh}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subjlname" value="${subjectTwoRegentry.jlzname}" readonly="readonly"/> <input
											type="hidden" name="subcfjiaolianid" value="${subjectTwoRegentry.cfjiaolianid}" readonly="readonly"/>
										</td>
										<td align="center"><input style="width: 120px;"
											type="text" name="subcfchexing" value="${subjectTwoRegentry.cfchexing}" readonly="readonly"/></td>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="本地" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 2 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="异地" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfbdyd eq 3 }">
										<td align="center"><input style="width: 90px;"
											type="text" name="subcflocal" value="学生" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfkscs" value="${subjectTwoRegentry.cfkscs}" readonly="readonly"/></td>
                                        <c:if test="${subjectTwoRegentry.cfkscs eq 0}">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfkscs gt 0}">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfckbk" value="补考" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfkscs eq null}">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfbxwx eq null}">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfbxwx" value="" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfbxwx eq 1}">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfbxwx" value="本校" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfbxwx eq 2 }">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfbxwx" value="外校" readonly="readonly"/></td>
                                        </c:if>
                                        <c:if test="${subjectTwoRegentry.cfkmyjgsj eq null }">
                                            <td align="center"><input style="width: 90px;"
                                                                      type="text" name="subcfkmyjgsj" value="" readonly="readonly"/></td>
                                        </c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj eq null }">
											<td align="center"><input style="width: 90px;"
											type="text" name="subcfkmyjgsj" value="" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
											<td align="center"><input style="width: 140px;"
											type="text" name="subcfkmyjgsj" value="${subjectTwoRegentry.cfkmyjgsj}" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj == null }">
											<td align="center"><input style="width: 140px;"
											type="text" name="subcfbjgsj" value="" readonly="readonly"/></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfkmyjgsj != null }">
										<td align="center"><input style="width: 140px;"
											type="text" name="subcfbjgsj" value="${subjectTwoRegentry.cfbjgsj}" readonly="readonly"/></td>
										</c:if>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfscts" value="${subjectTwoRegentry.cfscts}" readonly="readonly"/></td>
										<td align="center"><input style="width: 150px;"
											type="text" name="subcfclazz" value="${subjectTwoRegentry.cfclazz}" readonly="readonly"/></td>
										<td align="center"><input style="width: 90px;"
											type="text" name="subcfysje" value="${subjectTwoRegentry.cfysje}" readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfyhje" value="${subjectTwoRegentry.cfyhje}"readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfyisje" value="${subjectTwoRegentry.cfyisje}"readonly="readonly"/></td>
										<td align="center"><input type="text"
											style="width: 90px;" name="subcfqfje" value="${subjectTwoRegentry.cfqfje}" readonly="readonly"/></td>
										<td align="center"><input style="width: 150px;"
											type="text" name="subcfremark" value="${subjectTwoRegentry.cfremark}" /></td>
										<c:if test="${subjectTwoRegentry.cfdajj eq 0 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfdajj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfdajj eq null }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfdajj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfdajj eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" checked="checked" disabled="disabled"
											readonly="readonly" name="subcfdajj" value="1" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq 0 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfjnbjj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq null }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" disabled="disabled" readonly="readonly"
											name="subcfjnbjj" value="0" /></td>
										</c:if>
										<c:if test="${subjectTwoRegentry.cfjnbjj eq 1 }">
										<td align="center"><input style="width: 90px;"
											type="checkbox" checked="checked" disabled="disabled"
											readonly="readonly" name="subcfjnbjj" value="1" /></td>
										</c:if>
									</tr>
								</c:forEach>
                    </table>
                </div>

                <div style="margin-top: 10px; margin-left: 90px;">已退学员</div>
                <div class="div_zilei">
                   <%--  <div style="width: 88%;text-align: right;">
                        <img src="<%=path%>/image/insert2323.jpg" class="addTable">
                        <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px" class="addTable">添加</span>
                        <img src="<%=path%>/image/delete212.png" class="deleteTable">
                        <span class="deleteTable" style="color: #a9bbe0;font-size: 14px" class="deleteTable">删除</span>
                    </div> --%>
                </div>
                <div style="overflow:auto;min-height: 200px;width: 88%;margin-left: 90px">
                    <table id="table2" style="min-height:50px;border-spacing:0;width: 160%;white-space:nowrap;">
                        <tr class="tr">
                            <tr  class="tr">
                        	<td><%--<input type="checkbox">--%></td>
                            <td class="fseq">序号</td>
                            <td style="width: 90px;" align="center">准考证明编号</td>
                            <td style="width: 90px;" align="center">学员姓名</td>
                            <td style="width: 90px;" align="center">学员编码</td>
                            <td style="width: 90px;" align="center">编号</td>
                            <td style="width: 90px;" align="center">身份证号</td>
                            <td style="width: 90px;" align="center">性别</td>
                            <td style="width: 90px;" align="center">手机号码</td>
                            <td style="width: 90px;" align="center">电话</td>
                            <td style="width: 90px;" align="center">推荐人</td>
                            <td style="width: 90px;" align="center">申请准驾车型代号</td>
                            <td style="width: 90px;" align="center">教练</td>
                            <td style="width: 90px;" align="center">车型</td>
                            <td style="width: 90px;" align="center">本地/异地</td>
                            <td style="width: 90px;" align="center">考试次数</td>
                            <td style="width: 90px;" align="center">初考/补考</td>
                            <td style="width: 90px;" align="center">本校/外校</td>
                            <td style="width: 90px;" align="center">科目一及格时间</td>
                            <td style="width: 90px;" align="center">科目二不及格时间</td>
                            <td style="width: 90px;" align="center">据上次考试不及格天数</td>
                            <td style="width: 90px;" align="center">班级</td>
                            <td style="width: 90px;" align="center">已收</td>
                            <td style="width: 90px;" align="center">优惠</td>
                            <td style="width: 90px;" align="center">应收</td>
                            <td style="width: 90px;" align="center">欠费</td>
                            <td style="width: 90px;" align="center">备注</td>
                            <td style="width: 90px;" align="center">档案交接</td>
                        <td style="width: 90px;" align="center">技能表交接</td>
                        </tr>
                    </table>
                </div>
				<div class="div_input_hang">

                </div>
                <div class="div_input_hang">
                    <div class="input_hang">
                        <span class="gn_name">审核人&nbsp;:&nbsp;</span>
                        <input disabled="disabled" name="checkName" value="${subjectTwoReg.checkName }"/>
                    </div>
                    <div class="input_hang">
                        <span class="gn_name">创建者&nbsp;:&nbsp;</span>
                        <input disabled="disabled" name="createName" value="${subjectTwoReg.createName }"/>

                    </div>
                    <div class="input_hang">
                        <span class="gn_name">创建时间&nbsp;:&nbsp;</span>
                        <input disabled="disabled" name="fcreatetime"  style="color: gray;" readonly="readonly" value="${subjectTwoReg.fcreatetime }"/>
                    </div>
                </div>

                <div class="div_tj" style="padding-top: 0px">
                    <shiro:hasPermission name="/againstAuditSubjectTwoReg">
                        <div>
                            <input  class="input_submit fsh" value="" type="button" onclick="audit(3)">
                        </div>
                    </shiro:hasPermission>
                    <div>
                        <input type="button" class="input_submit cklc" value="" onclick="lookActivitiImg('${activitiBPMN_KEY}',$('.fnumber').val())">
                    </div>
                    <div>
                        <input type="button" class="input_back fh" value="" onclick="back()"/>
                    </div>
                </div>
            </form>
        </div>
        </c:if>
        <%--保存流程查询的结果--%>
        <%--有正在进行的流程--%>
        <c:if test="${activitiState eq 'power' || activitiState eq 'noAssign'}">
            <input type="hidden" class="activitiState" value="1">
        </c:if>
        <%--没有进行的流程--%>
        <c:if test="${activitiState eq 'noTask' || activitiState eq 'finish' || activitiState eq 'failed'}">
            <input type="hidden" class="activitiState" value="2">
        </c:if>
    </div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp" %>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script id="table-template1-sub" type="text/x-handlebars-template"></script>

<script id="table-template2-sub" type="text/x-handlebars-template">
    {{#each this}}
	<tr class="tr_td">
		<td><input type="checkbox" name="checkchilden" value="{{cfstudentid}}"></td>
 		<td><input type="text" class="fseq" name="subfseq" value="" readonly="readonly">
			<input type="hidden" class="subfid" name="subfid" value="{{cfstudentid}}" readonly="readonly">
			<input type="hidden" class="subcfclazzid" name="subcfclazzid" value="{{cfclazzid}}" readonly="readonly">
        </td>
        <td align="center"><input class="cfzkzmbh" style="width: 90px;" type="text" name="subcfzkzmbh" value="{{cfzkzmbh}}" readonly="readonly"/></td>
        <td align="center"><input style="width: 90px;" type="text" name="subfnameL2" value="{{studentName}}" class="clickName is_click_ne" readonly="readonly"/></td>
        <td align="center"><input style="width: 170px;" type="text" name="substufnumber" value="{{cfstudentno}}" readonly="readonly"/></td>
		<td align="center"><input style="width: 110px;" type="text" name="subfnumber" value="" readonly="readonly"/></td>
		<td align="center"><input style="width: 140px;" type="text" name="subcfidcardno" value="{{cfidcardno}}" readonly="readonly"/></td>
		{{#compare cfsex 1}}
			<td align="center"><input style="width: 90px;" type="text" name="subcfsex" value="男" readonly="readonly"/></td>
		 {{else}}
        	<td align="center"><input style="width: 90px;" type="text" name="subcfsex" value="女" readonly="readonly"/></td>
        {{/compare}}
        <td align="center"><input style="width: 90px;" type="text" name="subcfsjhm" value="{{cfmobile}}" readonly="readonly"/></td>
        <td align="center"><input style="width: 90px;" type="text" name="subcflxdh" value="{{cfphone}}" readonly="readonly"/></td>
        <td align="center"><input style="width: 90px;" type="text" name="subcftjrName" value="{{cfjsr}}" readonly="readonly"/>
		</td>
		<td align="center"><input type="text" style="width: 90px;" name="cfsqzjcxdh" value="{{cfsqzjcxdh}}" readonly="readonly"></td>
        <td align="center"><input style="width: 90px;" type="text" name="subjlname" value="{{jlzname}}"  readonly="readonly"/>
		<input type="hidden" name="subcfjiaolianid" value="{{cfjiaolianid}}">
		</td>
		<td align="center"><input style="width: 120px;" type="text" name="subcfchexing" value="{{cfchexing}}" readonly="readonly"></td>
		{{#compare cfbdyd 1}}
        <td align="center"><input style="width: 90px;" type="text" name="subcflocal" value="本地" readonly="readonly"/></td>
		{{/compare}}
		{{#compare cfbdyd 2}}
        <td align="center"><input style="width: 90px;" type="text" name="subcflocal" value="异地" readonly="readonly"/></td>
		{{/compare}}
		{{#compare cfbdyd 3}}
        <td align="center"><input style="width: 90px;" type="text" name="subcflocal" value="学生" readonly="readonly"/></td>
		{{/compare}}
        <td align="center"><input style="width: 90px;" type="text" name="subcfkscs" value="{{cfkscs}}" readonly="readonly"/></td>
		{{#compare cfkscs 0}}
			<td align="center"><input style="width: 90px;" type="text" name="subcfckbk" value="初考" readonly="readonly"/></td>
		{{else}}
        	<td align="center"><input style="width: 90px;" type="text" name="subcfckbk" value="补考" readonly="readonly"/></td>
		{{/compare}}
		{{#compare cfbxwx 1}}
        <td align="center"><input style="width: 90px;" type="text" name="subcfbxwx" value="本校" readonly="readonly"/></td>
		{{else}}
		 <td align="center"><input style="width: 90px;" type="text" name="subcfbxwx" value="外校" readonly="readonly"/></td>
		{{/compare}}
        <td align="center"><input style="width: 140px;" type="text" name="subcfkmyjgsj" value="{{cfkmyjgsj}}" readonly="readonly"/></td>
        <td align="center"><input style="width: 140px;" type="text" name="subcfbjgsj" value="{{cfbjgsj}}" readonly="readonly"/></td>
        {{#compare cfbxwx null}}
		 <td align="center"><input style="width: 90px;" type="text" name="subcfscts" value="0" readonly="readonly"/></td>
		{{else}}
        <td align="center"><input style="width: 90px;" type="text" name="subcfscts" value="{{cfscts}}" readonly="readonly"/></td>
        {{/compare}}
		<td align="center"><input style="width: 150px;" type="text" name="subcfclazz" value="{{cfclazz}}" readonly="readonly"/></td>
        <td align="center"><input style="width: 90px;" type="text" name="subcfysje" value="{{cfysje}}" readonly="readonly"/></td>
		<td align="center"><input type="text" style="width: 90px;" name="subcfyhje" value="{{cfyhje}}" readonly="readonly"></td>
		<td align="center"><input type="text" style="width: 90px;" name="subcfyisje" value="{{cfyisje}}" readonly="readonly"></td>
        <td align="center"><input type="text" style="width: 90px;" name="subcfqfje" value="{{cfqfje}}" readonly="readonly"></td>
        <td align="center"><input style="width: 150px;" type="text" name="subcfremark" value="{{cfremark}}" /></td>
		{{#compare cfdajj 0}}
        	<td align="center"><input style="width: 90px;" type="checkbox"  disabled="disabled" readonly="readonly" name="subcfdajj" value="0"/></td>
		{{/compare}}
		{{#compare cfdajj null}}
        	<td align="center"><input style="width: 90px;" type="checkbox"  disabled="disabled" readonly="readonly" name="subcfdajj" value="0"/></td>
		{{/compare}}
		{{#compare cfdajj 1}}
			<td align="center"><input style="width: 90px;" type="checkbox" checked="checked" disabled="disabled" readonly="readonly" name="subcfdajj" value="1"/></td>
		{{/compare}}
		{{#compare cfjnbjj 0}}
        	<td align="center"><input style="width: 90px;" type="checkbox" disabled="disabled" readonly="readonly" name="subcfjnbjj" value="0"/></td>
		{{/compare}}
		{{#compare cfjnbjj null}}
        	<td align="center"><input style="width: 90px;" type="checkbox" disabled="disabled" readonly="readonly" name="subcfjnbjj" value="0"/></td>
		{{/compare}}
        {{#compare cfjnbjj 1}}
			<td align="center"><input style="width: 90px;" type="checkbox" checked="checked" disabled="disabled" readonly="readonly" name="subcfjnbjj" value="1"/></td>
        {{/compare}}
    </tr>
	{{/each}}
</script>
<script type="text/javascript">

var _this;//记录当前点击对象
var yltcar=$("#cfzbsylt").val();//伊兰特车的数量
var stncar=$("#cfzbsstn").val();//桑塔纳车的数量
var sum = $("#cfzbs").val();//总指标的人数
//注册一个比较大小的Helper,判断v1是否大于v2
Handlebars.registerHelper("compare", function (v1, v2, options) {
	 	if (v1 == v2) {
   	 	//满足添加继续执行
    	return options.fn(this);
	} else {
    	//不满足条件执行{{else}}部分
    	return options.inverse(this);
	}
});

	//填充值的模板
var myTemplate2 = Handlebars.compile($("#table-template2-sub").html());

//删除一行
$(".deleteTable").click(function () {
	var k=0;//记录被选中复选框的个数
	var falg=$("input:checkbox[name=checkchilden]:checked").each(function (i){
		k++;
	})
	if(k == 0){
		alert("请勾选中需要删除的行！")
	}else{
		k=0;//记录数清零
		$("input:checkbox[name=checkchilden]:checked").each(function (i){
    		$(this).parent().parent().remove();
    		k++;//记录删除的条数
    		if($(this).parent().parent().find("td").eq("13").children("input").val() == '伊兰特BH7162MY'){
                yltcar -= 1;
    		}else{
    			stncar-=1;
    		}
    		$("#cfzbsylt").val(yltcar)
            $("#cfzbsstn").val(stncar)
    	})
    	//序列号
    	var i=1;
        $("input:text[name=subfseq]").each(function (j) {
        	$(this).val(i);
        	i++
        })
        sum-=k;
    	$("#cfzbs").val(sum)
    	$("#cfdqbkrs").val(sum)
    	$(".check1").removeAttr("checked");
	}

})

//选中需要考试的学员
$('.addTable').click(function () {
	var examdate=$("#ywrq").val();
	if(examdate == null || examdate == ''){
		alert("请选择考试日期！")
		$("#ywrq").focus()
	}else{
		getPagExamSub()
		$('#table1').html($('#table1').html());
   	    $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data').css('visibility', 'visible')
        //$(".check1 input:checkbox").removeAttr("checked");
        $('.page').show();
        $('#index').val(1)
	}

})
//查找符合预约过科目二考试的学员
function getPagExamSub(){
	var examdate=$("#ywrq").val().trim()//考试日期
	var carType=$(".cfcartype").val();
	var subjectType=$("#subjectType").val();
    myname = $('.name1').val();
    cflxdh = $('.cflxdh').val();
    $('#studebntList').html("<div class='loading'></div>");
    $.ajax({
        url: '<%=path2%>/DrivingSys/getPagExamSub?pindex=0&name=' + myname + '&cflxdh=' + cflxdh + '&beginTime=' + beginTime.val() + '&endTime=' + endTime.val()+'&examdate='+examdate+'&carType='+carType+'&subjectType='+subjectType,
        type: "get",
        dataType: "json",
        success: function (res) {
            $('#studebntList').html(myTemplate(res));
            $('#totalPage').val(res.pb);
        },
        error: function () {
            alert('Error');
        }
    });
}


/* 关闭弹出框    */
$('.btn').click(function () {
    $('#modal-overlay').css('visibility', 'hidden')
    $('.modal-data1').css('visibility', 'hidden')
    $('.modal-data').css('visibility', 'hidden')
    $('.modal-data9').css('visibility', 'hidden')
    $('.modal-data10').css('visibility', 'hidden')
    $('.head1 input:checkbox').removeAttr('checked');
    $('.page').hide();
    var i=1;
    $("input:text[name=subfseq]").each(function (j) {
        $(this).val(i);
		i++
    })
	_this=null;//清空 _this
})

//设置全选功选
$('.check1').live('click', function () {
		if($(this).attr("checked")){
            $('input:checkbox[name=checkchilden]').attr("checked", ":checked")
        } else {
			 $('input:checkbox[name=checkchilden]').removeAttr('checked');
		}
	})

   //由于和input:checkbox冲突，在选择一次
 $("#table1 tr td input:checkbox:not(.check1)").live('click',function(){
	  if($(this).is(':checked')){
	    	$(this).removeAttr("checked");
	    }else{
	    	$(this).attr("checked",":checked")
      }
 })
  //单击选中
  $("#table1 tr td").live('click',function(){
    if($(this).parent().find("input:checkbox[name=checkchilden]").is(':checked')){
    	$(this).parent().find("input:checkbox[name=checkchilden]").removeAttr("checked");
    }else{
    	$(this).parent().find("input:checkbox[name=checkchilden]").attr("checked",":checked")
    }
  })

//弹出模式框
 $('.clickName').live('click',function(){
     getPagExamSub()
     $('#modal-overlay').css('visibility', 'visible')
     $('.modal-data').css('visibility', 'visible')
     //$('input:checkbox').removeAttr('checked');
     $('.page').show();
     _this = e.parent().parent();
 })



//双击确定
$(document).on('dblclick','.xysj td',function(){
    var spCodesTemp = $(this).parent().find("input:checkbox[name=student]").val();
    var lcsjids = $(this).parent().find("input:checkbox[name=student]").next().val()//练车时间id
	if(spCodesTemp == null || lcsjids == null ){
   return false;
	}
	   $.ajax({
       url: '<%=path%>/DrivingSys/selSubjectTwoRegentryBysutid',
       type: "post",
       async: true,
       data: {'id': spCodesTemp,'lcsjids':lcsjids},
       dataType: "json",
       success: function (res) {
           addStudentMesg(res)
       },
       error: function () {
           alert('Error');
       }
       })
})

//把选中的信息名称填充到输入框中
$('.subtn').click(function () {
    var spCodesTemp = "";
    $('input:checkbox[name=student]:checked').each(function (i) {
        if (0 == i) {
            //把学生id增加到字表中
            spCodesTemp = $(this).val();

        } else {
            spCodesTemp += ("," + $(this).val());

        }
    });
    var lcsjids = ""//练车时间id
    $('input:checkbox[name=student]:checked').next().each(function (j) {
    	if(j == 0){
    		lcsjids=$(this).val();
    	}else{
    		lcsjids+=(","+$(this).val());
    	}
    });
    if(spCodesTemp == ''){
        alert("请选择一条数据")
        return false
    }
    $.ajax({
        url: '<%=path%>/DrivingSys/selSubjectTwoRegentryBysutid',
        type: "post",
        data: {'id': spCodesTemp,'lcsjids':lcsjids},
        dataType: "json",
        success: function (res) {
            addStudentMesg(res);
        },
        error: function () {
            alert('Error');
        }
    });

});

//把查找到学员信息填充进去
function addStudentMesg(res){
    if(res == -1){
        alert("需要的学员中出现与科目二分车数据不匹配!");
        return false;
    }
    var students = "";
    var count =0;//计数
    for(var j=0;j<res.length;j++){
        $(".subfid").each(function(i) {
            if ($(this).val() == res[j].cfstudentid) {
                var name = $(this).parent().parent().find("td input[name=subfnameL2]").val();
                if (count == 0) {
                    students = name;
                } else {
                    students += "," + name;
                }
                count++;
            }
        })
    }
    if(students != ''){
        alert(students+" 已经在列表中,请重新选择学员!")
        return false;
    }
	for (var i = 0; i < res.length; i++) {
        //alert(res[i].cfbjgsj)
    	if(res[i].cfbjgsj != null && res[i].cfbjgsj !=''){
    		var date1 = stringToTime(res[i].cfbjgsj);//科目二不及格时间
            var date2 = new Date().getTime();//系统当前时间
    		var day = dateDiff(date1, date2)
    		day = parseInt(day)//去掉小数点取整天数
            res[i].cfscts = day;//距离不及格考试天数
    	}
		if(res[i].cfchexing == '伊兰特BH7162MY'){
			yltcar+=1;
		}else{
			stncar+=1;
		}
		//考试次数
		if(res[i].cfkscs == null){
			res[i].cfkscs = 0;
		}
		//优惠金额
		if(res[i].cfyhje == null){
			res[i].cfyhje = 0;
		}
		//不及格时间
		if(res[i].cfbjgsj == null){
			res[i].cfbjgsj = '';
		}
		//距离现在不及格天数
		if(res[i].cfscts == null){
			res[i].cfscts = 0;
		}
    }
    var htmlhead1 = $('#table1').html();
    if(_this == null){
        $('#table1').html(htmlhead1+myTemplate2(res));
    }else{
        _this.find("input:hidden[name=subfid]").val(res[0].cfstudentid)
        _this.find("input:hidden[name=subcfclazzid]").val(res[0].cfclazzid)
        _this.find("input:text[name=subcfzkzmbh]").val(res[0].cfzkzmbh)
        _this.find("input:text[name=subfnameL2]").val(res[0].studentName)
        _this.find("input:text[name=substufnumber]").val(res[0].cfstudentno)
        _this.find("input:text[name=subcfidcardno]").val(res[0].cfidcardno)
        if(res[0].cfsex == 1){
            res[0].cfsex = '男'
        }else{
            res[0].cfsex = '女'
        }
        _this.find("input:text[name=subcfsex]").val(res[0].cfsex)
        _this.find("input:text[name=subcfsjhm]").val(res[0].cfmobile)
        _this.find("input:text[name=subcflxdh]").val(res[0].cfphone)
        _this.find("input:text[name=subcftjrName]").val(res[0].cfjsr)
        _this.find("input:text[name=cfsqzjcxdh]").val(res[0].cfsqzjcxdh)
        _this.find("input:text[name=subjlname]").val(res[0].jlzname)
        _this.find("input:hidden[name=subcfjiaolianid]").val(res[0].cfjiaolianid)
        _this.find("input:text[name=subcfchexing]").val(res[0].cfchexing)
        _this.find("input:hidden[name=subcfchepaihao]").val(res[0].cfchepaihao)
        if(res[0].cflocal == 1){
            res[0].cflocal = '本地';
        }else if(res[0].cflocal == 2){
            res[0].cflocal = '异地'
        }else{
            res[0].cflocal = '学生'
        }
        _this.find("input:text[name=subcflocal]").val(res[0].cflocal)
        _this.find("input:text[name=subcfkscs]").val(res[0].cfkscs)
        if(res[0].cfkscs == 0){
            res[0].cfkscs = '初考'
        }else if(res[0].cfkscs == null){
            res[0].cfkscs = '初考'
        }else{
            res[0].cfkscs = '补考'
        }
        _this.find("input:text[name=subcfckbk]").val(res[0].cfckbk)
        if(res[0].cfbxwx == 1){
            res[0].cfbxwx = '本校'
        }else if(res[0].cfbxwx == null){
            res[0].cfbxwx = ''
        }else{
            res[0].cfbxwx = '外校'
        }
        _this.find("input:text[name=subcfbxwx]").val(res[0].cfbxwx)
        _this.find("input:text[name=subcfkmyjgsj]").val(res[0].cfkmyjgsj)
        _this.find("input:text[name=subcfbjgsj]").val(res[0].cfbjgsj)
        if(res[0].cfbjgsj != null && res[0].cfbjgsj !=''){
            var date1 = stringToTime(res[0].cfbjgsj);//科目二不及格时间
            var date2 = new Date().getTime();//系统当前时间
            var day = dateDiff(date1, date2)
            day = parseInt(day)//去掉小数点取整天数
            res[0].cfscts=day;//距离不及格考试天数
        }
        _this.find("input:text[name=subcfscts]").val(res[0].cfscts)
        _this.find("input:text[name=subcfclazz]").val(res[0].cfclazz)
        _this.find("input:text[name=subcfysje]").val(res[0].cfysje)
        _this.find("input:text[name=subcfyhje]").val(res[0].cfyhje)
        _this.find("input:text[name=subcfyisje]").val(res[0].cfyisje)
        _this.find("input:text[name=subcfqfje]").val(res[0].cfqfje)
        _this.find("input:text[name=subcfremark]").val(res[0].cfremark)
        if(res[0].cfdajj == 0 || res[0].cfdajj == null){
            _this.find("input:checkbox[name=subcfdajj]").removeAttr('checked');
        }else{
            _this.find("input:checkbox[name=subcfdajj]").attr('checked');
            _this.find("input:checkbox[name=subcfdajj]").prop("disabled",true);
        }
        if(res[0].cfjnbjj == 0 || res[0].cfjnbjj == null){
            _this.find("input:checkbox[name=subcfjnbjj]").removeAttr('checked');
        }else{
            _this.find("input:checkbox[name=subcfjnbjj]").attr('checked');
            _this.find("input:checkbox[name=subcfjnbjj]").prop("disabled",true);
        }
        _this=null;//清空 _this
    }
	var i=1;
    $("input:text[name=subfseq]").each(function (j) {
        $(this).val(i);
    	i++
    })
    $("#cfzbsylt").val(yltcar)
    $("#cfzbsstn").val(stncar)
    sum+=res.length;
    $("#cfzbs").val(sum)
    $("#cfdqbkrs").val(sum)
    $('#modal-overlay').css('visibility', 'hidden');
    $('.modal-data').css('visibility', 'hidden')
    _this=null;//清空 _this
}

//添加预约科目二的学员
$('.addSubscribeStudent').click(function () {
	var examdate=$("#ywrq").val().trim();//考试日期
    var carType = $(".cfcartype").val();//车型
	if(examdate == null || examdate == ''){
		alert("考试日期不能为空！")
		$("#ywrq").focus()
	}else{
	    //添加学员
	    selExamsubscribeTwoByExamdateAndCarType(examdate,carType)
	}


});
//根据考试日期和驾照类型查找学员
function selExamsubscribeTwoByExamdateAndCarType(examdate,carType){
	//添加数据
	$.ajax({
        url: '<%=path%>/DrivingSys/selExamsubscribeTwoByExamdateAndCarType',
        type: "post",
        data: {'examdate': examdate,'carType':carType},
        dataType: "json",
        success: function (res) {
        	if(res == null || res ==''){
        		alert("抱歉，"+examdate+"没有预约科目二"+carType+"的学员！")
            } else {
                //addStudentMesg(res)
                if(res == -1){
                    alert("需要添加的学员中出现与科目二分车数据不匹配!");
                    return false;
                }
                var students = "";
                var count =0;//计数
                var item = new Array();//记录重复学员对象的下标
                for(var j=0;j<res.length;j++){
                    $(".subfid").each(function(i) {
                        if ($(this).val() == res[j].cfstudentid) {
                            item.push(j)
                            var name = $(this).parent().parent().find("td input[name=subfnameL2]").val();
                            if (count == 0) {
                                students = name;
                            } else {
                                students += "," + name;
                            }
                            count++;
                        }
                    })
                }
                if(students != ''){
                    for (var k = 0;k<item.length;k++){
                        delete (res[item[k]]);//删除重复的学员对象
                    }
                    alert(students+" 已经在列表中!")
                    //return false;
                }
                for (var i = 0; i < res.length; i++) {
                    if(item.length == 0){
                        //不及格时间
                        if(res[i].cfbjgsj == null){
                            res[i].cfbjgsj = "";
                        }
                        if(res[i].cfbjgsj != null && res[i].cfbjgsj !=''){
                            var date1 = stringToTime(res[i].cfbjgsj);//科目二不及格时间
                            var date2 = new Date().getTime();//系统当前时间
                            var day = dateDiff(date1, date2)
                            day = parseInt(day)//去掉小数点取整天数
                            res[i].cfscts=day;//距离不及格考试天数
                        }
                        if(res[i].cfchexing == '伊兰特BH7162MY'){
                            yltcar+=1;
                        }else{
                            stncar+=1;
                        }
                        //考试次数
                        if(res[i].cfkscs == null){
                            res[i].cfkscs = 0;
                        }
                        //优惠金额
                        if(res[i].cfyhje == null){
                            res[i].cfyhje = 0;
                        }
                    }else{
                        for (var j =0; j<item.length;j++){
                            if(i != item[j]){
                                //不及格时间
                                if(res[i].cfbjgsj == null){
                                    res[i].cfbjgsj = "";
                                }
                                if(res[i].cfbjgsj != null && res[i].cfbjgsj !=''){
                                    var date1 = stringToTime(res[i].cfbjgsj);//科目二不及格时间
                                    var date2 = new Date().getTime();//系统当前时间
                                    var day = dateDiff(date1, date2)
                                    day = parseInt(day)//去掉小数点取整天数
                                    res[i].cfscts=day;//距离不及格考试天数
                                }
                                if(res[i].cfchexing == '伊兰特BH7162MY'){
                                    yltcar+=1;
                                }else{
                                    stncar+=1;
                                }
                                //考试次数
                                if(res[i].cfkscs == null){
                                    res[i].cfkscs = 0;
                                }
                                //优惠金额
                                if(res[i].cfyhje == null){
                                    res[i].cfyhje = 0;
                                }
                            }
                        }
                    }
                }
                $("#cfzbsylt").val(yltcar)
                $("#cfzbsstn").val(stncar)
                sum += res.length-item.length;
                $("#cfzbs").val(sum)
                $("#cfdqbkrs").val(sum)
                var htmlhead1 = $('#table1').html();
                $('#table1').html(htmlhead1+myTemplate2(res));
                //处理序号
                var i=1;
                $("input:text[name=subfseq]").each(function (j){
                    $(this).val(i);
                    i++
                })
        	}
        },
        error: function () {
            alert('Error');
        }
    });
}

//计算两个日期之前相差的天数
function dateDiff(date1, date2) {
    var type1 = typeof date1, type2 = typeof date2;
    if (type1 == 'string')
        date1 = stringToTime(date1);
    else if (date1.getTime)
        date1 = date1.getTime();
    if (type2 == 'string')
        date2 = stringToTime(date2);
    else if (date2.getTime)
        date2 = date2.getTime();
    return (date2 - date1) / 1000 / 60 / 60 / 24;
    /* //除1000是毫秒，不加是秒   */
}

//字符串转成Time(dateDiff)所需方法
function stringToTime(string) {
    var f = string.split(' ', 2);
    var d = (f[0] ? f[0] : '').split('-', 3);
    var t = (f[1] ? f[1] : '').split(':', 3);
    return (new Date(
        parseInt(d[0], 10) || null,
        (parseInt(d[1], 10) || 1) - 1,
        parseInt(d[2], 10) || null,
        parseInt(t[0], 10) || null,
        parseInt(t[1], 10) || null,
        parseInt(t[2], 10) || null)).getTime();
}
//返回
function back() {
    parent.closeSelectCard()

//    location = '<%=path%>/DrivingSys/querySubjectTwoReg/look.action';
}


//改变审核状态
    function audit(num) {
        var fid = $("input:hidden[name=fid]").val();
        var fnumber =$("input:text[name=fnumber]").val();
        if(fid == null || fnumber == null){
            return false;
        }
        if(num == 3){//反审核
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data10').css('visibility', 'visible')
            var activitiState=$('.activitiState').val();
            $("#againstAuditsubmit").click(function(){
                var againstAuditcomment = $("#againstAuditcomment").val();
                if (againstAuditcomment == null || againstAuditcomment == '') {
                    againstAuditcomment = "不同意";
                }
                $.ajax({
                    url:'<%=path%>/DrivingSys/againstCheckSubjectTwoRegActiviti',
                    type:'post',
                    data:{'fid':fid,'fnumber':fnumber,'againstAuditcomment':againstAuditcomment,'activitiState':activitiState},
                    dataType:'json',
                    success:function(result){
                        if(result["result"] == 'success'){
                            showAlert("反审核成功!","querySubjectTwoReg/look.action")
                           /* alert("反审核成功!")
                            setTimeout(function () {
                                location="<%=path%>/DrivingSys/querySubjectTwoReg/look.action";
                            }, 1000);*/

                        }else{
                            alert("反审核失败!")
                        }
                    },
                    error:function () {alert('Error')}
                })
            })

        }
        if(num == 4){//提交
            $.messager.confirm('提示', '是否提交?', function (r) {
                if(r){
                    $.ajax({
                        url:'<%=path%>/DrivingSys/submitSubjectTwoRegActiviti',
                        type:'post',
                        data:{'fid':fid,'fnumber':fnumber},
                        dataType:'json',
                        success:function(result){
                            if(result["result"] == 'success'){
                                showAlert("提交成功!","querySubjectTwoReg/look.action")
                               /* alert("提交成功!")
                                setTimeout(function () {
                                    location="<%=path%>/DrivingSys/querySubjectTwoReg/look.action";
                                }, 1000);*/
                            }else{
                                alert("提交失败!")
                            }
                        },
                        error:function () {alert('Error')}
                    })
                }
            })
        }

        if(num == 5){   //审核
            $('#modal-overlay').css('visibility', 'visible')
            $('.modal-data9').css('visibility', 'visible')
            $("#auditsubmit").click(function() {
                var agree = $("input:radio[name=check]:checked").val();//同意不同意
                var auditcomment = $("#auditcomment").val();
                if (agree == null) {
                    alert("你选择你的意见");
                    return false;
                }
                if (auditcomment == null || auditcomment == '') {
                    if(agree == "1"){
                        auditcomment = "同意";
                    }else{
                        auditcomment = "不同意";
                    }
                }

                $.ajax({
                    url:'<%=path%>/DrivingSys/checkSubjectTwoRegActiviti',
                    type:'post',
                    data:{'fid':fid,'fnumber':fnumber,'agree':agree,'auditcomment':auditcomment},
                    dataType:'json',
                    // async: true,
                    success:function(result){
                        if(result["result"] == 'success'){
                            showAlert("审核成功!","querySubjectTwoReg/look.action")
                           /* alert("审核成功!")
                            setTimeout(function () {
                                location="<%=path%>/DrivingSys/querySubjectTwoReg/look.action";
                            }, 1000);*/
                        }else if(result["result"] == 'isNoResponsiblePerson'){
                            alert("当前用户不是要求的经办人!")
                        }else if(result["result"] == 'successAndOver'){
                            showAlert("此流程成功推进，并且此流程已经结束!!","querySubjectTwoReg/look.action")
                            /*alert("此流程成功推进，并且此流程已经结束!")
                            setTimeout(function () {
                                location="<%=path%>/DrivingSys/querySubjectTwoReg/look.action";
                            }, 1000);*/
                        }else{
                            alert("审核失败")
                        }
                    },
                    error:function () {alert('Error')}
                })
            })

        }
    }
    function subForm(){
        var count =0;
        $("input:checkbox[name=checkchilden]").each(function(i){
            count ++;
        })
        if(count == 0){
            alert("请先添加学员!")
            return false;
        }
        $("input[type='submit']").attr("disabled", "disabled");
    }
//改变业务日期或者车型清空已经增加的学员
var oldTime =$("#ywrq").val();//记录改变之前的时间
function changeFbizdate(obj) {
    var k = 0;
    $("input:checkbox[name=checkchilden]").each(function(i){
        k++;
    })
    if(k != 0){
        $.messager.confirm('提示', '考试时间或者车型改变，将清空之前录入的学员数据!', function (r) {
            if (r) {
                $("input:checkbox[name=checkchilden]").each(function (i) {
                    $(this).parent().parent().remove()
                })
                sum = sum - k;
                yltcar -= $("#cfzbsylt").val();//伊兰特车的数量
                stncar -= $("#cfzbsstn").val();//桑塔纳
                $("#cfzbs").val(sum)
                $("#cfdqbkrs").val(sum)
                $("#cfzbsylt").val(yltcar)
                $("#cfzbsstn").val(stncar)
                oldTime = $("#ywrq").val()
            } else {
                $("#ywrq").val(oldTime)
            }
        })
    }else{//把oldTime赋值
        oldTime = $("#ywrq").val()
    }
}

var oldCartype = $(".cfcartype").val();//记录之前的车型
function changeCartype() {
    var k = 0;
    $("input:checkbox[name=checkchilden]").each(function (i) {
        k++;
    })
    if (k != 0) {
        $.messager.confirm('提示', '考试时间或者车型改变，将清空之前录入的学员数据!', function (r) {
            if (r) {
                $("input:checkbox[name=checkchilden]").each(function (i) {
                    $(this).parent().parent().remove()
                })
                sum = sum - k;
                yltcar -= $("#cfzbsylt").val();//伊兰特车的数量
                stncar -= $("#cfzbsstn").val();//桑塔纳
                $("#cfzbs").val(sum)
                $("#cfdqbkrs").val(sum)
                $("#cfzbsylt").val(yltcar)
                $("#cfzbsstn").val(stncar)
                oldCartype = $(".cfcartype").val()
            } else {
                $(".cfcartype").val(oldCartype)
            }
        })
    } else {//把oldTime赋值
        oldCartype = $(".cfcartype").val()
    }
}

</script>
</html>